<?php

/**
 * Syllabus form base class.
 *
 * @package    elearning
 * @subpackage form
 * @author     Your name here
 */
class BaseSyllabusForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'level_id'    => new sfWidgetFormPropelChoice(array('model' => 'Level', 'add_empty' => false)),
      'unit_number' => new sfWidgetFormInput(),
      'created_at'  => new sfWidgetFormDateTime(),
      'updated_at'  => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorPropelChoice(array('model' => 'Syllabus', 'column' => 'id', 'required' => false)),
      'level_id'    => new sfValidatorPropelChoice(array('model' => 'Level', 'column' => 'id')),
      'unit_number' => new sfValidatorInteger(),
      'created_at'  => new sfValidatorDateTime(array('required' => false)),
      'updated_at'  => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('syllabus[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Syllabus';
  }

  public function getI18nModelName()
  {
    return 'SyllabusI18n';
  }

  public function getI18nFormClass()
  {
    return 'SyllabusI18nForm';
  }

}
